package com.dodayum.controller;

import com.dodayum.dao.BigDataDemo;
import com.dodayum.service.BigDataDemoServiceImpl;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping
public class DemoController {

    @Resource
    BigDataDemoServiceImpl bigDataDemoService;

    @GetMapping("/")
    public String get(){
        return "启动成功"+System.currentTimeMillis();
    }

    @GetMapping("/insert")
    public String insert(){
        return bigDataDemoService.buildDemoData();
    }

    @GetMapping("/threadRunInfo")
    public String threadRunInfo(){
        return bigDataDemoService.getThreadRunInfo();
    }

    @GetMapping("/selectAll")
    public List<BigDataDemo> getAll(){
        return bigDataDemoService.selectAll();
    }
}
